package com.dameng.jianyouquan.mvp.presenter.impl;

import com.dameng.jianyouquan.base.mvpBase.BasePresenterImpl;
import com.dameng.jianyouquan.mvp.model.RegisterModel;
import com.dameng.jianyouquan.mvp.presenter.RegisterPresenter;
import com.dameng.jianyouquan.mvp.view.view.RegisterView;

public class RegisterPresenterImpl extends BasePresenterImpl<RegisterView> implements RegisterPresenter, RegisterModel.OnRegisterListener, RegisterModel.OnSendVerificationCodeListener {


    private RegisterView mView;
    private RegisterModel mModel;

    public RegisterPresenterImpl(RegisterView mView, RegisterModel mModel) {
        this.mView = mView;
        this.mModel = mModel;
    }

    @Override
    public void register(String phoneNum, String verificationCode, String pwd) {
        mModel.register(phoneNum,verificationCode,pwd,this);
    }


    @Override
    public void sendVerificationCode(String PhoneNum) {
        mModel.sendVerificationCode(PhoneNum,this);
    }

    @Override
    public void registerSuccess() {
        mView.registerSuccess();
    }

    @Override
    public void registerFail(String msg) {
        mView.registerFail(msg);
    }

    @Override
    public void sendVerificationCodeSuccess() {
        mView.sendVerificationCodeSuccess();
    }

    @Override
    public void sendVerificationCodeFail(String msg) {
        mView.sendVerificationCodeFail(msg);
    }
}
